home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7857 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: mudskipper.cac.psu.edu!user
  2. From: fcusack@tdx.org (frank.)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Derived class not calling overloaded base class function
  5. Date: Mon, 19 Feb 1996 07:17:17 -0400
  6. Organization: Psychic Enemies Network
  7. Message-ID: <fcusack-1902960717170001@mudskipper.cac.psu.edu>
  8. References: <4g46t2$3vd@otis.netspace.net.au>
  9. NNTP-Posting-Host: mudskipper.cac.psu.edu
  10.  
  11. In article <4g46t2$3vd@otis.netspace.net.au>, TorrBoy@netspace.net.au wrote:
  12.  
  13. > Hi,
  14. > Hopefully a very simple question someone can answer for me!
  15. > I have a class, say 'foo' (everyone's favourite) which has a member function 
  16. > 'int Get(void)'
  17. > I then derive a class (say 'goo') which has as a base class foo. If goo has a 
  18. > function also called Get, but with different params (say ''char
  19. *Get(char *)') I can't 
  20. > seem to get the base class' Get() function to operate within the derived
  21. class.
  22.  
  23. How about posting some sample code???? Here are my non-sensical answers to
  24. nonsensical (to me, anyway) questions:
  25.  
  26. > If I say just plain "Get()" it says too few parameters (for Get(char *)".
  27.  
  28. There is no way to call 'just plain "Get()"' because it is a member
  29. function of a class and you need to call it through an object of that
  30. class.
  31.  
  32. >   If I use 
  33. > "::Get()" the compiler complains Get should have a prototype.
  34.  
  35. The use of "::Get()" tries to call a global function named Get().
  36.  
  37. >   If I say "foo.Get()" it 
  38. > says improper use of typedef foo.
  39.  
  40. foo.Get()??? You don't call a member function like this through the class
  41. name, but through an object of that class.
  42. ~Frank
  43.  -- I am Pentium of Borg.  Division is futile.  You will be approximated. --
  44.  --   If you build it, they will come --> http://www.tdx.org/~fcusack/    --
  45.  -- PGP key fingerprint: 01 C0 C0 B9 CC 78 67 0F  3F 64 80 65 8B 0F F9 EA --
  46.